<template>
  <div class="panel shadow" :style="{width: width}">
    <div class="head flex between item-center">
        <h4>{{ title }}</h4>
        <div class="right">
            <slot name="value">
                <span @click="moreData()">更多&gt;</span>
            </slot>
        </div>
    </div>
    <div class="content">
        <slot name="content"></slot>
    </div>
  </div>
</template>

<script>

export default {
    props: {
        title: {
            type: String,
            require: true,
            default: '标题'
        },
        width: {
            type: String,
            require: false,
            default: '100%'
        },
        more: {
            type: String,
            require: false,
            default: ''
        }
    },
    methods: {
        moreData() {
            if (!this.more) {
                return ;
            }
            this.$router.push(this.more)
        }
    }
}
</script>

<style lang="scss" scoped>
.panel {
    padding: 10px;
    .head {
        height: 50px;
        h4 {
            font-size: 16px;
            font-weight: 600;
        }
        .right {
            font-size: 12px;
            cursor: pointer;
        }
    }
}
</style>